package com.fms.gui.main;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Rectangle;

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

public class FMSMainGUI extends JFrame
{
	private static final long	serialVersionUID	= 7152880868773071204L;

	public FMSMainGUI(JComponent createSheetButton, JComponent existingDisplay, String title)
	{
		this.setTitle(title);
		this.setLayout(new BorderLayout());
		
		JPanel topPanel = new JPanel(new BorderLayout());
		topPanel.add(createSheetButton, BorderLayout.WEST);
		
		this.add(topPanel, BorderLayout.NORTH);
		this.add(existingDisplay, BorderLayout.CENTER);
		this.setSize(1000, 720);
		
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.centerScreen();
	}
	
	public void centerScreen() 
	{
		  Dimension dim = getToolkit().getScreenSize();
		  Rectangle abounds = getBounds();
		  setLocation((dim.width - abounds.width) / 2,
		      (dim.height - abounds.height) / 2);
	}
}
